import requests
import json
import execjs

js = execjs.compile(open('04.js', encoding='utf-8').read())

headers = {
    "accept": "application/json, text/plain, */*",
    "accept-language": "zh-CN,zh;q=0.9",
    "cache-control": "no-cache",
    "content-type": "application/json",
    "form-token": "97e491bafd39375ea26797ea015ade85",
    "nsssjss": js.call('get_data'),
    "origin": "https://shanxisheng-zfcgdzmcgov.cn",
    "pragma": "no-cache",
    "priority": "u=1, i",
    "referer": "https://shanxisheng-zfcgdzmcgov.cn/gpmall-main-web/basic/sxNotice",
    "regioncode": "140001000",
    "regionguid": "140001",
    "sec-ch-ua": "\"Google Chrome\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "sitecode": "sxzfcg",
    # "siteguid": "6883226032309207040",
    # "timestamp": "1733644335002",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
    "webapp": "1"
}

url = "https://shanxisheng-zfcgdzmcgov.cn/gpmall-bpoc/notice/v1/ignore/getNoticeList"
data = {
    "regionGuid": "232",
    "regionCode": "140000000",
    "agreementTypeCode": "",
    "pageSize": 10,
    "pageNum": 3,
    "noticeType": "0"
}
data = json.dumps(data, separators=(',', ':'))
response = requests.post(url, headers=headers, data=data)

print(response.text)
print(response)
